<script setup lang="ts">
import { useUserStore } from '@/store/modules/user'
import { storeToRefs } from 'pinia'

const userStore = useUserStore()
const { currentModel } = storeToRefs(userStore)

defineOptions({
  name: 'Header'
})

// 定义props
const props = defineProps<{
  modelName: string
}>()

// 定义事件
const emit = defineEmits<{
  (e: 'open-model-selector'): void
}>()

// 打开模型选择器
const handleOpenModelSelector = () => {
  emit('open-model-selector')
}
</script>

<template>
  <div class="flex items-center overflow-hidden">
    <div class="text-btn ml-auto mt-4 mr-4" @click="handleOpenModelSelector">
      <span class="hidden sm:inline">{{ currentModel?.name }}</span>
      <i class="iconfont icon-ios-arrow-down"></i>
    </div>
  </div>
</template>
